package com.lighthouse.doc.view.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lighthouse.doc.view.mapper.KnowledgeDocViewMapper;
import com.lighthouse.doc.view.domain.KnowledgeDocView;
import com.lighthouse.doc.view.service.IKnowledgeDocViewService;

/**
 * 文档-用户浏览关联Service业务层处理
 * 
 * @author ysz
 * @date 2023-06-10
 */
@Service
public class KnowledgeDocViewServiceImpl implements IKnowledgeDocViewService 
{
    @Autowired
    private KnowledgeDocViewMapper knowledgeDocViewMapper;

    /**
     * 查询文档-用户浏览关联
     * 
     * @param docId 文档-用户浏览关联主键
     * @return 文档-用户浏览关联
     */
    @Override
    public KnowledgeDocView selectKnowledgeDocViewByDocId(String docId)
    {
        return knowledgeDocViewMapper.selectKnowledgeDocViewByDocId(docId);
    }

    /**
     * 查询文档-用户浏览关联列表
     * 
     * @param knowledgeDocView 文档-用户浏览关联
     * @return 文档-用户浏览关联
     */
    @Override
    public List<KnowledgeDocView> selectKnowledgeDocViewList(KnowledgeDocView knowledgeDocView)
    {
        return knowledgeDocViewMapper.selectKnowledgeDocViewList(knowledgeDocView);
    }

    /**
     * 新增文档-用户浏览关联
     * 
     * @param knowledgeDocView 文档-用户浏览关联
     * @return 结果
     */
    @Override
    public int insertKnowledgeDocView(KnowledgeDocView knowledgeDocView)
    {
        return knowledgeDocViewMapper.insertKnowledgeDocView(knowledgeDocView);
    }

    /**
     * 修改文档-用户浏览关联
     * 
     * @param knowledgeDocView 文档-用户浏览关联
     * @return 结果
     */
    @Override
    public int updateKnowledgeDocView(KnowledgeDocView knowledgeDocView)
    {
        return knowledgeDocViewMapper.updateKnowledgeDocView(knowledgeDocView);
    }

    /**
     * 批量删除文档-用户浏览关联
     * 
     * @param docIds 需要删除的文档-用户浏览关联主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeDocViewByDocIds(String[] docIds)
    {
        return knowledgeDocViewMapper.deleteKnowledgeDocViewByDocIds(docIds);
    }

    /**
     * 删除文档-用户浏览关联信息
     * 
     * @param docId 文档-用户浏览关联主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeDocViewByDocId(String docId)
    {
        return knowledgeDocViewMapper.deleteKnowledgeDocViewByDocId(docId);
    }

    /**
     * 查询最近文档浏览
     * @param noticer 用户id
     * @return 文档信息集合
     */
    public List<String> selectKnowledgeDocViewRecent(Long noticer) {
        return knowledgeDocViewMapper.selectKnowledgeDocViewRecent(noticer);
    }
}
